package cn.tworice.client.service.impl;

import cn.tworice.client.dao.ResumeDao;
import cn.tworice.client.service.ResumeService;
import cn.tworice.common.entity.dto.ResumeReceivedDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 简历相关服务层
 * @Author 二饭
 * @Email 1786705138@qq.com
 * @Date 2021/12/14 15:10
 */
@Service
public class ResumeServiceImpl implements ResumeService {
    @Autowired
    private ResumeDao resumeDao;

    /**
     * 通过公司ID获取所有收到的简历
     * @Author 二饭
     * @Email 1786705138@qq.com
     * @Date 2021/12/14 15:37
     */
    @Override
    public List<ResumeReceivedDto> getResumeReceivedByCompaniesId(String companiesId,Integer page,Integer pageSize) {
        return resumeDao.queryResumeReceivedByCompaniesId(companiesId,(page*pageSize),pageSize);
    }

    /**
     * 通过公司ID获取收到的简历数量
     * @Author 二饭
     * @Email 1786705138@qq.com
     * @Date 2021/12/14 15:37
     */
    @Override
    public Integer getResumeReceivedCount(String companiesId) {
        return resumeDao.queryResumeReceivedCount(companiesId);
    }
}
